Parallel Computing Architectures and APIs by Vivek Kale
Author:Vivek Kale
Language: eng
Format: epub
Publisher: CRC Press
The former processes an input key-value pair, producing a set of intermediate pairs. The latter is in charge of combining all the intermediate values related to a particular key, outputting a set of merged output values (usually just one). MapReduce is often explained illustrating a possible solution to the problem of counting the number of occurrences of each word in a large collection of documents. The following pseudocode refers to the functions that need to be implemented.
map(String input_key, String input_value):
//input_key: document name
//input_value: document contents
for each word w in input_value:
EmitIntermediate(w, “1”);
reduce(String output_key,
Iterator intermediate_values):
//output_key: a word
//output_values: a list of counts
int result = 0;
for each v in intermediate_values:
result += ParseInt(v);
Emit(AsString(result));
The map function emits in output each word together with an associated count of occurrences (in this simple example, just one). The reduce function provides the required result by summing all the counts emitted for a specific word. MapReduce implementations (e.g., Google App Engine and Hadoop) then automatically parallelize and execute the program on a large cluster of commodity machines. The runtime system takes care of the details of partitioning the input data, scheduling the program’s execution across a set of machines, handling machine failures, and managing required inter-machine communication.
The programming model for MapReduce architecture is a simple abstraction where the computation takes a set of input key-value pairs associated with the input data and produces a set of output key-value pairs. The overall model for this process is shown in Figure 13.1. In the Map phase, the input data is partitioned into input splits and assigned to Map tasks associated with processing nodes in the cluster. The Map task typically executes on the same node that contains its assigned partition of data in the cluster. These Map tasks perform user-specified computations on each input key-value pair from the partition of input data assigned to the task and generates a set of intermediate results for each key. The shuffle and sort phase then takes the intermediate data generated by each Map task, sorts it with intermediate data from other nodes, divides it into regions to be processed by the reduce tasks, and distributes it as needed to nodes where the Reduce tasks will execute. All Map tasks must complete prior to the shuffle and sort and reduce phases. The number of Reduce tasks does not need to be the same as the number of Map tasks. The Reduce tasks perform additional user-specified operations on the intermediate data, possibly merging values associated with a key to a smaller set of values to produce the output data. For more complex data processing procedures, multiple MapReduce calls may be linked together in sequence.
Figure 13.1
Execution phases in a generic MapReduce application.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Blood, Sweat, and Pixels by Jason Schreier(3485)
Dawn of the New Everything by Jaron Lanier(2689)
Godot 4 Game Development Cookbook by Jeff Johnson(2554)
The Art of Doom by Bethesda(2037)
Significant Zero by Walt Williams(1885)
Creative Character Design by Bryan Tillman(1842)
World of Warcraft Chronicle Volume 3 by Blizzard Entertainment(1663)
The Ultimate Roblox Book by David Jagneaux(1617)
Art Of Atari by Tim Lapetino(1567)
Pillars of Eternity Guidebook by Obsidian Entertainment(1539)
Dawn of the New Everything: Encounters with Reality and Virtual Reality by Jaron Lanier(1539)
1628927445Game by Unknown(1478)
Unreal Engine 4 Virtual Reality Projects by Kevin Mack(1474)
Mission Python by Sean McManus(1457)
Unreal Engine Virtual Reality Quick Start Guide by Jessica Plowman(1453)
The Ultimate Player's Guide to Minecraft by Stephen O'Brien(1421)
Learning D by 2015(1419)
Unity 2018 By Example by Alan Thorn(1394)
Road Games by Road Games(1369)
